
/**
\file
Defines the rainbow::culling_state class.
\author Sean Tromans
*/

#ifndef	RAINBOW_GRAPHICS_DEVICE_CULLING_STATE_HPP
#define	RAINBOW_GRAPHICS_DEVICE_CULLING_STATE_HPP

#include <sun/gl.hpp>
#include <sun/lua/lua_fwd.hpp>

namespace rainbow
{

	/**
	Defines the settings for a user defined GPU culling state.
	\author Sean Tromans
	*/
	struct culling_state
	{
		/**
		Default Constructor.
		\author Sean Tromans
		*/
		culling_state( );

		/**
		Applies any changes from the provided culling_state to OpenGL.
		@param other The currently active culling_state.
		\author Sean Tromans
		*/
		void apply( culling_state const & other ) const;

		bool	enabled;	///< Whether the culling is enabled.
		GLenum	mode;		///< The culling mode to be used when rendering polygons.

		/**
		Exposes the culling_state to lua.
		@param L The Lua State being initialised.
		\author Sean Tromans.
		*/
		static void lua_interface( lua_State * L );
	};

	/**
	Comparrison operator for culling_states.
	@param lhs The first culling_state being compared.
	@param rhs The second culling_state being compared.
	@return True if the culling_states are equal.
	\author Sean Tromans
	*/
	bool operator == ( culling_state const & lhs, culling_state const & rhs );

}

#endif	//RAINBOW_GRAPHICS_DEVICE_CULLING_STATE_HPP
